package com.kaiwukj.android.ufamily.mvp.ui.adapter;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.kaiwukj.android.ufamily.R;
import com.kaiwukj.android.ufamily.mvp.http.entity.bean.ItemOwnPayBean;

import java.util.List;

public class OwnPayAdapter extends BaseQuickAdapter<ItemOwnPayBean, BaseViewHolder> {


    public int getType(int pos) {
        ItemOwnPayBean item = getItem(pos);
        if (item == null) {
            return 0;
        }
        return item.getType();
    }

    public OwnPayAdapter(@Nullable List<ItemOwnPayBean> data) {
        super(R.layout.item_own_pay, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, ItemOwnPayBean item) {
        helper.setText(R.id.tv_name, item.getName());
        helper.setText(R.id.tv_desc, item.getDesc());
        helper.setBackgroundResource(R.id.item_root, item.getBgResId());
    }


}
